Ext.define('js.foundation.FoundationGczlccBg', {
    extend: 'Ext.panel.Panel',
    id: 'FoundationGczlccBg',
    margin:'50 0 0 0',
    config: {
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
    },
    buttonNum:1,
    initComponent: function () {
        this.dockedItems = [
            {
                dock: 'top',
                xtype: 'toolbar',
                cls:'toolbarStyle',
                style:{
                    background:'#fff',
                    border: '2px solid #5294ee'
                },
                items: [{
                    xtype: 'button',
                    cls: 'buttonsetA',
                    scale: 'medium',
                    id:'jgsthntqdAA',
                    text: '<div id="jgsthntqdA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 130px;border-bottom:2px solid #2672d9"><span id="jgsthntqd" style="margin-left: -5px;color:#2672d9">结构实体混凝土强度</span></div>',
                    scale: 'medium',
                    margin:'0 2 0 0',
                    width:280,
                    height:60,
                    scope: this,
                    action_type: 'regionAdd',
                    enterprise_id: this.enterprise_id,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationGczlccBg');
                        if(me.buttonNum ===2){
                            Ext.getDom('jgsthntqdAA').style.background='#fff';
                            document.getElementById('jgsthntqd').style.color='#2672d9';
                            me.buttonNum=1
                        }else{
                            Ext.getDom('jgsthntqdAA').style.background='#fff';
                            document.getElementById('jgsthntqd').style.color='#2672d9';
                            document.getElementById('jgsthntqdA').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('Gjwzslbhchd').style.background='#fff';
                            document.getElementById('GjwzslbhchdAx').style.color='#000';
                            document.getElementById('GjwzslbhchdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('qtsjqdA').style.background='#fff';
                            document.getElementById('qtsjqdx').style.color='#000';
                            document.getElementById('qtsjqd').style.borderBottom='2px solid #fff';

                            Ext.getDom('zjmgl').style.background='#fff';
                            document.getElementById('zjmglAx').style.color='#000';
                            document.getElementById('zjmglA').style.borderBottom='2px solid #fff';

                            me.buttonNum=2;

                        }
                        me.removeAll(true);
                        let jcstatus=11;
                        let ztstatus=12;
                        let qtstatus=13;
                        let basicInformationPanel = Ext.create('js.foundation.FoundationJgstShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:this.PageName,
                            engineering_id:this.engineering_id,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            //结构实体混凝土强度
                            statusAA:this.structural_solid_concrete_strength,
                            jcstatus:jcstatus,
                            ztstatus:ztstatus,
                            qtstatus:qtstatus
                        });
                        me.add(basicInformationPanel);
                    }
                },{
                    text: '<div id="GjwzslbhchdA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 183px;border-bottom:2px solid #2672d9"><span id="GjwzslbhchdAx" style="margin-left: -5px;">钢筋位置/数量/保护层厚度</span></div>',
                    cls: 'buttonsetA',
                    id:'Gjwzslbhchd',
                    scale: 'medium',
                    width:280,
                    height:60,
                    margin:'0 2 0 0',
                    handler: this.refresh,
                    scope: this,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationGczlccBg');
                        if(me.buttonNum ===3){
                            Ext.getDom('Gjwzslbhchd').style.background='#fff';
                            document.getElementById('GjwzslbhchdAx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{

                            Ext.getDom('jgsthntqdAA').style.background='#fff';
                            document.getElementById('jgsthntqd').style.color='#000';
                            document.getElementById('jgsthntqdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('Gjwzslbhchd').style.background='#fff';
                            document.getElementById('GjwzslbhchdAx').style.color='#2672d9';
                            document.getElementById('GjwzslbhchdA').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('qtsjqdA').style.background='#fff';
                            document.getElementById('qtsjqdx').style.color='#000';
                            document.getElementById('qtsjqd').style.borderBottom='2px solid #fff';

                            Ext.getDom('zjmgl').style.background='#fff';
                            document.getElementById('zjmglAx').style.color='#000';
                            document.getElementById('zjmglA').style.borderBottom='2px solid #fff';
                            me.buttonNum=3;

                        }
                        me.removeAll(true);
                        let jcstatus=14;
                        let ztstatus=15;
                        let qtstatus=16;
                        //自定义为15
                        let basicInformationPanel = Ext.create('js.foundation.FoundationJgstShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:this.PageName,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            jcstatus:jcstatus,
                            ztstatus:ztstatus,
                            qtstatus:qtstatus,
                            engineering_id:this.engineering_id,
                            //钢筋位置、数量、保护层厚度
                            statusAA:this.reinforcement_data,
                        });
                        me.add(basicInformationPanel);
                    }
                }, {
                    text: '<div id="qtsjqd" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 85px;border-bottom:2px solid #2672d9"><span id="qtsjqdx" style="margin-left: -5px;">砌体砂浆强度</span></div>',
                    margin:'0 2 0 0',
                    width:240,
                    height:60,
                    id:'qtsjqdA',
                    scale: 'medium',
                    cls: 'buttonsetA',
                    name: 'btnDeleteRegion',
                    handler: this.deleteRegionConfirm,
                    scope: this,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationGczlccBg');
                        if(me.buttonNum ===4){
                            Ext.getDom('qtsjqdA').style.background='#fff';
                            document.getElementById('qtsjqdx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{
                            Ext.getDom('jgsthntqdAA').style.background='#fff';
                            document.getElementById('jgsthntqd').style.color='#000';
                            document.getElementById('jgsthntqdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('Gjwzslbhchd').style.background='#fff';
                            document.getElementById('GjwzslbhchdAx').style.color='#000';
                            document.getElementById('GjwzslbhchdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('qtsjqdA').style.background='#fff';
                            document.getElementById('qtsjqdx').style.color='#2672d9';
                            document.getElementById('qtsjqd').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('zjmgl').style.background='#fff';
                            document.getElementById('zjmglAx').style.color='#000';
                            document.getElementById('zjmglA').style.borderBottom='2px solid #fff';
                            me.buttonNum=4;
                        }
                        me.removeAll(true);
                        let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:'js.foundation.FoundationABShowPage',
                            status:17,
                            engineering_id:this.engineering_id,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            //切体砂浆强度
                            Zstsatus:this.masonry_mortar_strength,
                        });
                        me.add(basicInformationPanel);
                    }
                }, {
                    text: '<div id="zjmglA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 67px;border-bottom:2px solid #2672d9"><span id="zjmglAx" style="margin-left: -5px;">植筋锚固力</span></div>',
                    margin:'0 2 0 0',
                    width:240,
                    height:60,
                    id:'zjmgl',
                    scale: 'medium',
                    cls: 'buttonsetA',
                    name: 'btnDeleteRegion',
                    handler: this.deleteRegionConfirm,
                    scope: this,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationGczlccBg');
                        if(me.buttonNum ===5){
                            Ext.getDom('zjmgl').style.background='#fff';
                            document.getElementById('zjmglAx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{
                            Ext.getDom('jgsthntqdAA').style.background='#fff';
                            document.getElementById('jgsthntqd').style.color='#000';
                            document.getElementById('jgsthntqdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('Gjwzslbhchd').style.background='#fff';
                            document.getElementById('GjwzslbhchdAx').style.color='#000';
                            document.getElementById('GjwzslbhchdA').style.borderBottom='2px solid #fff';

                            Ext.getDom('qtsjqdA').style.background='#fff';
                            document.getElementById('qtsjqdx').style.color='#000';
                            document.getElementById('qtsjqd').style.borderBottom='2px solid #fff';

                            Ext.getDom('zjmgl').style.background='#fff';
                            document.getElementById('zjmglAx').style.color='#2672d9';
                            document.getElementById('zjmglA').style.borderBottom='2px solid #2672d9';
                            me.buttonNum=5;
                        }
                        me.removeAll(true);
                        let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:'js.foundation.FoundationABShowPage',
                            status:18,
                            engineering_id:this.engineering_id,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            //植筋锚固力
                            Zstsatus:this.planting_anchor,
                        });
                        me.add(basicInformationPanel);
                    }
                }
                ]
            }];
        this.callParent(arguments);
        this.on('afterrender',this.show);
    },
    show:function(){
        let me =  Ext.getCmp('FoundationGczlccBg');
        if(me.buttonNum ===2){
            Ext.getDom('jgsthntqdAA').style.background='#fff';
            document.getElementById('jgsthntqd').style.color='#2672d9';
            me.buttonNum=1
        }else{
            Ext.getDom('jgsthntqdAA').style.background='#fff';
            document.getElementById('jgsthntqd').style.color='#2672d9';
            document.getElementById('jgsthntqdA').style.borderBottom='2px solid #2672d9';

            Ext.getDom('Gjwzslbhchd').style.background='#fff';
            document.getElementById('GjwzslbhchdA').style.color='#000';
            document.getElementById('GjwzslbhchdA').style.borderBottom='2px solid #fff';

            Ext.getDom('qtsjqdA').style.background='#fff';
            document.getElementById('qtsjqd').style.color='#000';
            document.getElementById('qtsjqd').style.borderBottom='2px solid #fff';

            Ext.getDom('zjmgl').style.background='#fff';
            document.getElementById('zjmglA').style.color='#000';
            document.getElementById('zjmglA').style.borderBottom='2px solid #fff';

            me.buttonNum=2;

        }
        me.removeAll(true);
        let jcstatus=11;
        let ztstatus=12;
        let qtstatus=13;
        let basicInformationPanel = Ext.create('js.foundation.FoundationJgstShowBg', {
            margin:'10 10 30 10',
            storeAll: this.storeAll,
            PageName:this.PageName,
            engineering_id:this.engineering_id,
            engineering_no:this.engineering_no,
            engineering_name:this.engineering_name,
            //结构实体混凝土强度
            statusAA:this.structural_solid_concrete_strength,
            jcstatus:jcstatus,
            ztstatus:ztstatus,
            qtstatus:qtstatus,
        });
        me.add(basicInformationPanel);
    }
});